import { createSSRApp } from 'vue'
import * as Pinia from 'pinia'
import mixins from './utils/mixins'
import util from '@/utils/util'

import App from './App.vue'
export function createApp() {
  const app = createSSRApp(App)
  app.use(Pinia.createPinia())
  app.mixin(mixins)
  app.config.globalProperties.$utils = util
  app.config.globalProperties.$onLaunched = new Promise((resolve) => {
    app.config.globalProperties.$isResolve = resolve
  })

  return {
    app,
    Pinia
  }
}
